home *** CD-ROM | disk | FTP | other *** search
/ Champak 106 / Vol 106.iso / games / rain_for.swf / scripts / __Packages / smashing / SoundHandler.as < prev    next >
Encoding:
Text File  |  2010-04-12  |  882 b   |  41 lines

  1. class smashing.SoundHandler
  2. {
  3.    var location;
  4.    var aSnd;
  5.    var cSound = 0;
  6.    function SoundHandler(loc)
  7.    {
  8.       this.location = loc;
  9.       this.aSnd = [];
  10.       var _loc3_ = undefined;
  11.       var _loc2_ = 0;
  12.       while(_loc2_ < 8)
  13.       {
  14.          _loc3_ = loc.createEmptyMovieClip("mcSnd" + _loc2_,_loc2_);
  15.          this.aSnd[_loc2_] = new Sound(_loc3_);
  16.          _loc2_ = _loc2_ + 1;
  17.       }
  18.    }
  19.    function playSnd(sId, vol)
  20.    {
  21.       var _loc2_ = this.aSnd[this.cSound];
  22.       _loc2_.stop();
  23.       if(vol != undefined)
  24.       {
  25.          _loc2_.setVolume(vol);
  26.       }
  27.       else
  28.       {
  29.          _loc2_.setVolume(100);
  30.       }
  31.       _loc2_.attachSound(sId);
  32.       _loc2_.start();
  33.       this.cSound = this.cSound + 1;
  34.       if(this.cSound >= this.aSnd.length)
  35.       {
  36.          this.cSound = 0;
  37.       }
  38.       return _loc2_;
  39.    }
  40. }
  41.